package cn.wolfcode.trip.admin.controller;

import cn.wolfcode.trip.base.domain.Theme;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IThemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
// 景点主题的控制器
@Controller
@RequestMapping("/theme")
public class ThemeController {
    @Autowired
    private IThemeService themeService;

    @RequestMapping("/list")
    public String list(Model model, QueryObject qo) {
        qo.setPageSize(7);
        model.addAttribute("pageInfo", themeService.query(qo));
        return "theme/list";
    }

    @RequestMapping("/saveOrUpdate")
    public String saveOrUpdate(Theme entity) {
        themeService.saveOrUpdate(entity);
        return "redirect:/scene/list.do";
    }

}
